/* 
 * File:   No.h
 * Author: nata
 *
 * Created on March 13, 2012, 3:13 PM
 */

#ifndef NO_H
#define	NO_H

#include "Image.h"

enum Type {
    BISS,
    LEAF
};

enum Orientation {
    HORIZONTAL,
    VERTICAL
};

class Node {
private:
    Type type;
    Orientation orientation;
    Image* image;
    Node* left;
    Node* right;
    Node* father;
    int id;
    void setId(int id);
//    void copy(Node* raiz);
    
public:
    //Node(Type type);
    Node(Image* image);
    Node(Node* left, Orientation orientation, Node* right);
    Node(Node* node); //copy
    
    void setBissection(Node* left, Orientation orientation, Node* right);
    void setLeaf(Image* image);
    void setLeft(Node* left);
    void setRight(Node* right);
    void setFather(Node* father);

    Image* getImage();
    Node* getFather();
    Orientation getOrientation();
    Node* getLeft();
    Node* getRight();

    double getHeight(int alpha, int beta);
    double getWidth(int alpha, int beta);
    double getArea(int alpha, int beta);
    Type getType();
    int getId();    
    void enumerate(); //
    bool isLeaf();
    double sumImageAreas();
    double sumPriorities();
};

#endif	/* NO_H */

